package com.hqyj.system.service.impl;

import com.hqyj.system.mapper.StockMapper;
import com.hqyj.system.model.Stock;
import com.hqyj.system.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockServiceImpl  implements StockService {
    @Autowired
    private StockMapper stockMapper;

    @Override
    public List<Stock> queryAllStock() {
        return stockMapper.queryAllStock();
    }

    @Override
    public int addStockByStock(Stock stock) {
        return stockMapper.addStockByStock(stock);
    }

    @Override
    public int deleteStockrBystockId(int stockId) {
        return stockMapper.deleteByPrimaryKey(stockId);
    }

    @Override
    public int updateStockByStock(Stock stock) {
        return stockMapper.updateStockByStock(stock);
    }

    @Override
    public Stock queryStockByStockId(int stockId) {
        return stockMapper.queryStockByStockId(stockId);
    }


}
